package com.aspose.cells;

import java.util.HashMap;

class zakq {
   private static zlw a;
   private static final com.aspose.cells.b.c.a.za b = new com.aspose.cells.b.c.a.za(new String[]{".xls", ".xlsx", ".xlsm", ".xltx", ".xltm", ".xlam", ".xml", ".xlsb", ".txt", ".csv", ".ods", ".htm", ".html", ".mht", ".mhtml", ".ots"});

   static zlw a() {
      if (a == null) {
         a = new zlw();
      }

      return a;
   }

   static int a(double var0, double var2) {
      if (var0 < 3.8D) {
         return 38;
      } else if (var0 < 3.9D) {
         return var2 < 8.0D ? 37 : 19;
      } else if (var0 < 4.0D) {
         return 43;
      } else if (var0 < 4.3D) {
         return 20;
      } else if (var0 < 4.45D) {
         return var2 < 8.9D ? 27 : 36;
      } else if (var0 < 4.49D) {
         return var2 < 7.5D ? 31 : 32;
      } else if (var0 < 4.65D) {
         return 21;
      } else if (var0 < 4.9D) {
         return 22;
      } else if (var0 < 5.25D) {
         return 23;
      } else if (var0 < 5.7D) {
         return 6;
      } else if (var0 < 6.0D) {
         return 11;
      } else if (var0 < 6.8D) {
         return 28;
      } else if (var0 < 7.3D) {
         return 13;
      } else if (var0 < 7.9D) {
         return 7;
      } else if (var0 < 8.36D) {
         return 9;
      } else if (var0 < 8.48D) {
         return 15;
      } else if (var0 < 8.58D) {
         if (var2 < 11.5D) {
            return 1;
         } else if (var2 < 12.5D) {
            return 40;
         } else {
            return var2 < 13.5D ? 14 : 5;
         }
      } else if (var0 < 8.85D) {
         return 47;
      } else if (var0 < 9.01D) {
         return 44;
      } else if (var0 < 9.4D) {
         return 30;
      } else if (var0 < 9.9D) {
         return 12;
      } else if (var0 < 10.5D) {
         return var2 < 12.5D ? 45 : 16;
      } else if (var0 < 11.4D) {
         return 17;
      } else if (var0 < 12.2D) {
         return 8;
      } else if (var0 < 13.7D) {
         return 29;
      } else if (var0 < 14.9D) {
         return 39;
      } else {
         return var0 < 16.0D ? 46 : 9;
      }
   }

   static void a(PageSetup var0, double[] var1, double[] var2) {
      var1[0] = 0.0D;
      var2[0] = 0.0D;
      int var5 = var0.getPaperSize();
      double var3;
      switch(var5) {
      case 1:
         var3 = 8.5D;
         var1[0] = com.aspose.cells.b.a.zq.b(var3, 2);
         var2[0] = 11.0D;
         break;
      case 2:
         var3 = 8.5D;
         var1[0] = com.aspose.cells.b.a.zq.b(var3, 2);
         var2[0] = 11.0D;
         break;
      case 3:
         var1[0] = 11.0D;
         var2[0] = 17.0D;
         break;
      case 4:
         var1[0] = 17.0D;
         var2[0] = 11.0D;
         break;
      case 5:
         var3 = 8.5D;
         var1[0] = com.aspose.cells.b.a.zq.b(var3, 2);
         var2[0] = 14.0D;
         break;
      case 6:
         var1[0] = 5.5D;
         var2[0] = 8.5D;
         break;
      case 7:
         var3 = 7.5D;
         var1[0] = com.aspose.cells.b.a.zq.b(var3, 2);
         var3 = 10.5D;
         var2[0] = com.aspose.cells.b.a.zq.b(var3, 2);
         break;
      case 8:
         var1[0] = com.aspose.cells.b.a.zq.b(11.692913385826772D, 2);
         var2[0] = com.aspose.cells.b.a.zq.b(16.535433070866144D, 2);
         break;
      case 9:
         var1[0] = com.aspose.cells.b.a.zq.b(8.267716535433072D, 2);
         var2[0] = com.aspose.cells.b.a.zq.b(11.692913385826772D, 2);
         break;
      case 10:
         var1[0] = com.aspose.cells.b.a.zq.b(8.267716535433072D, 2);
         var2[0] = com.aspose.cells.b.a.zq.b(11.692913385826772D, 2);
         break;
      case 11:
         var1[0] = com.aspose.cells.b.a.zq.b(5.826771653543307D, 2);
         var2[0] = com.aspose.cells.b.a.zq.b(8.267716535433072D, 2);
         break;
      case 12:
         var1[0] = com.aspose.cells.b.a.zq.b(10.118110236220472D, 2);
         var2[0] = com.aspose.cells.b.a.zq.b(14.330708661417324D, 2);
         break;
      case 13:
         var1[0] = com.aspose.cells.b.a.zq.b(7.165354330708662D, 2);
         var2[0] = com.aspose.cells.b.a.zq.b(10.118110236220472D, 2);
         break;
      case 14:
         var3 = 8.5D;
         var1[0] = com.aspose.cells.b.a.zq.b(var3, 2);
         var2[0] = 13.0D;
         break;
      case 15:
         var1[0] = com.aspose.cells.b.a.zq.b(8.46456692913386D, 2);
         var2[0] = com.aspose.cells.b.a.zq.b(10.826771653543307D, 2);
         break;
      case 16:
         var1[0] = 10.0D;
         var2[0] = 14.0D;
         break;
      case 17:
         var1[0] = 11.0D;
         var2[0] = 17.0D;
         break;
      case 18:
         var3 = 8.5D;
         var1[0] = com.aspose.cells.b.a.zq.b(var3, 2);
         var2[0] = 11.0D;
         break;
      case 19:
         var3 = 3.875D;
         var1[0] = com.aspose.cells.b.a.zq.b(var3, 2);
         var3 = 8.875D;
         var2[0] = com.aspose.cells.b.a.zq.b(var3, 2);
         break;
      case 20:
         var3 = 4.125D;
         var1[0] = com.aspose.cells.b.a.zq.b(var3, 2);
         var3 = 9.5D;
         var2[0] = com.aspose.cells.b.a.zq.b(var3, 2);
         break;
      case 21:
         var3 = 4.5D;
         var1[0] = com.aspose.cells.b.a.zq.b(var3, 2);
         var3 = 10.375D;
         var2[0] = com.aspose.cells.b.a.zq.b(var3, 2);
         break;
      case 22:
         var3 = 4.75D;
         var1[0] = com.aspose.cells.b.a.zq.b(var3, 2);
         var2[0] = 11.0D;
         break;
      case 23:
         var1[0] = 5.0D;
         var3 = 11.5D;
         var2[0] = com.aspose.cells.b.a.zq.b(var3, 2);
      case 24:
      case 25:
      case 26:
         break;
      case 27:
         var1[0] = com.aspose.cells.b.a.zq.b(4.330708661417323D, 2);
         var2[0] = com.aspose.cells.b.a.zq.b(8.661417322834646D, 2);
         break;
      case 28:
         var1[0] = com.aspose.cells.b.a.zq.b(6.377952755905512D, 2);
         var2[0] = com.aspose.cells.b.a.zq.b(9.015748031496063D, 2);
         break;
      case 29:
         var1[0] = com.aspose.cells.b.a.zq.b(12.755905511811024D, 2);
         var2[0] = com.aspose.cells.b.a.zq.b(18.031496062992126D, 2);
         break;
      case 30:
         var1[0] = com.aspose.cells.b.a.zq.b(9.015748031496063D, 2);
         var2[0] = com.aspose.cells.b.a.zq.b(12.755905511811024D, 2);
         break;
      case 31:
         var1[0] = com.aspose.cells.b.a.zq.b(4.488188976377953D, 2);
         var2[0] = com.aspose.cells.b.a.zq.b(6.377952755905512D, 2);
         break;
      case 32:
         var1[0] = com.aspose.cells.b.a.zq.b(4.488188976377953D, 2);
         var2[0] = com.aspose.cells.b.a.zq.b(9.015748031496063D, 2);
         break;
      case 33:
         var1[0] = com.aspose.cells.b.a.zq.b(9.84251968503937D, 2);
         var2[0] = com.aspose.cells.b.a.zq.b(13.89763779527559D, 2);
         break;
      case 34:
         var1[0] = com.aspose.cells.b.a.zq.b(6.929133858267717D, 2);
         var2[0] = com.aspose.cells.b.a.zq.b(9.84251968503937D, 2);
         break;
      case 35:
         var1[0] = com.aspose.cells.b.a.zq.b(6.929133858267717D, 2);
         var2[0] = com.aspose.cells.b.a.zq.b(4.921259842519685D, 2);
         break;
      case 36:
         var1[0] = com.aspose.cells.b.a.zq.b(4.330708661417323D, 2);
         var2[0] = com.aspose.cells.b.a.zq.b(9.05511811023622D, 2);
         break;
      case 37:
         var3 = 3.875D;
         var1[0] = com.aspose.cells.b.a.zq.b(var3, 2);
         var3 = 7.5D;
         var2[0] = com.aspose.cells.b.a.zq.b(var3, 2);
         break;
      case 38:
         var3 = 3.625D;
         var1[0] = com.aspose.cells.b.a.zq.b(var3, 2);
         var3 = 6.5D;
         var2[0] = com.aspose.cells.b.a.zq.b(var3, 2);
         break;
      case 39:
         var3 = 14.875D;
         var1[0] = com.aspose.cells.b.a.zq.b(var3, 2);
         var2[0] = 11.0D;
         break;
      case 40:
         var3 = 8.5D;
         var1[0] = com.aspose.cells.b.a.zq.b(var3, 2);
         var2[0] = 12.0D;
         break;
      case 41:
         var3 = 8.5D;
         var1[0] = com.aspose.cells.b.a.zq.b(var3, 2);
         var2[0] = 13.0D;
         break;
      default:
         var1[0] = com.aspose.cells.b.a.zq.b(8.267716535433072D, 2);
         var2[0] = com.aspose.cells.b.a.zq.b(11.692913385826772D, 2);
      }

      if (var0.getOrientation() == 0) {
         double var6 = var1[0];
         var1[0] = var2[0];
         var2[0] = var6;
      }

   }

   static void a(com.aspose.cells.b.a.d.zm var0, com.aspose.cells.b.a.d.zm var1) throws Exception {
      long var2 = var0.i();
      byte[] var4 = new byte[4096];

      while(true) {
         int var5 = var0.a(var4, 0, var4.length);
         if (var5 <= 0) {
            var1.a(0L, 0);
            var0.a(var2, 0);
            return;
         }

         var1.b(var4, 0, var5);
      }
   }

   static boolean a(com.aspose.cells.b.a.d.zm var0) throws Exception {
      com.aspose.cells.b.a.d.za var1 = new com.aspose.cells.b.a.d.za(var0);
      int var2 = var1.q();
      var0.a(-4L, 1);
      return var2 == 67324752;
   }

   static int a(String var0, com.aspose.cells.b.a.d.zm var1, boolean[] var2, int[] var3) throws Exception {
      var2[0] = false;
      byte var4 = 6;
      if (var1.h() < 8L) {
         var3[0] = 0;
         String var9 = com.aspose.cells.b.a.d.zk.d(var0);
         if (var9 != null) {
            switch(b.a(var9.toLowerCase())) {
            case 0:
               var2[0] = true;
               var4 = 5;
               break;
            case 1:
            case 2:
            case 3:
            case 4:
            case 5:
               var2[0] = true;
               var4 = 6;
               break;
            case 6:
               var2[0] = true;
               var4 = 15;
               break;
            case 7:
               var2[0] = true;
               var4 = 16;
               break;
            case 8:
               var2[0] = true;
               var4 = 11;
               break;
            case 9:
               var2[0] = true;
               var4 = 1;
               break;
            case 10:
               var2[0] = true;
               var4 = 14;
               break;
            case 11:
            case 12:
               var2[0] = true;
               var4 = 12;
               break;
            case 13:
            case 14:
               var2[0] = true;
               var4 = 13;
            }
         }

         return var4;
      } else {
         com.aspose.cells.b.a.d.za var5 = new com.aspose.cells.b.a.d.za(var1);
         long var6 = var5.s();
         var3[0] = (int)(var6 & 65535L);
         var1.a(-8L, 1);
         String var8;
         if (var6 == -2226271756974174256L) {
            var2[0] = true;
            var4 = 5;
         } else if ((var6 & 4294967295L) == 67324752L) {
            var2[0] = true;
            var4 = 6;
            if (var0 != null) {
               var8 = com.aspose.cells.b.a.d.zk.d(var0);
               if (var8 != null) {
                  switch(b.a(var8.toLowerCase())) {
                  case 1:
                  case 2:
                  case 3:
                  case 4:
                  case 5:
                     var4 = 6;
                  case 6:
                  case 8:
                  case 9:
                  case 11:
                  case 12:
                  case 13:
                  case 14:
                  default:
                     break;
                  case 7:
                     var4 = 16;
                     break;
                  case 10:
                  case 15:
                     var4 = 14;
                  }
               }
            }
         } else {
            int var10 = a(var1, var5, var6);
            switch(var10) {
            case 1:
               var2[0] = true;
               var4 = 15;
               break;
            case 2:
               var2[0] = true;
               var4 = 12;
               break;
            case 3:
               var2[0] = true;
               var4 = 13;
            }
         }

         if (!var2[0] && var0 != null) {
            var8 = com.aspose.cells.b.a.d.zk.d(var0);
            if (var8 != null) {
               switch(b.a(var8.toLowerCase())) {
               case 8:
                  var2[0] = true;
                  return 11;
               case 9:
                  var2[0] = true;
                  return 1;
               case 10:
               default:
                  break;
               case 11:
               case 12:
                  var2[0] = true;
                  return 12;
               case 13:
               case 14:
                  var2[0] = true;
                  return 13;
               }
            }
         }

         return var4;
      }
   }

   static String a(int var0, int var1, boolean var2, boolean var3) {
      ++var0;
      StringBuilder var4 = new StringBuilder();
      if (var3) {
         var4.append('$');
      }

      var4.append(CellsHelper.columnIndexToName(var1));
      if (var2) {
         var4.append('$');
      }

      var4.append(com.aspose.cells.b.a.zo.a(var0));
      return com.aspose.cells.b.a.zr.a(var4);
   }

   static int a(com.aspose.cells.b.a.d.zm var0, com.aspose.cells.b.a.d.za var1, long var2) throws Exception {
      byte var4 = 0;
      if ((var2 & 16777215L) == 12565487L) {
         var0.a(3L, 1);
         var2 >>= 24;
      } else if ((var2 & 65535L) == 65279L || (var2 & 65535L) == 65534L) {
         var1 = new com.aspose.cells.b.a.d.za(var0, Encoding.getUnicode());
         var0.a(2L, 1);
         var4 = 1;
         var2 >>= 16;
      }

      while((var2 & 255L) == 10L || (var2 & 255L) == 13L || (var2 & 255L) == 9L) {
         var2 >>= 8;
         var0.a(1L, 1);
      }

      String var5;
      if ((var2 & 255L) == 60L) {
         var5 = zbpt.a(var1, 5, var4 > 0).toLowerCase();
         if (var5.equals("<?xml")) {
            var0.a(0L, 0);
            return 1;
         }

         if (var5.equals("<html") || var5.equals("<tabl")) {
            var0.a(0L, 0);
            return 2;
         }

         if (var5.equals("<!doc")) {
            var5 = var5 + zbpt.a(var1, 9, var4 > 0).toLowerCase();
            if ("<!doctype html".equals(var5)) {
               var0.a(0L, 0);
               return 2;
            }
         }
      }

      if ((var2 & 255L) == 77L) {
         var5 = zbpt.a(var1, 4, var4 > 0).toLowerCase();
         if (var5.equals("mime")) {
            var0.a(0L, 0);
            return 3;
         }
      }

      var0.a(0L, 0);
      return -1;
   }

   static boolean a(byte[] var0) {
      if (var0 != null && var0.length >= 8) {
         long var1 = com.aspose.cells.b.a.zc.c(var0, 0);
         return var1 == -2226271756974174256L;
      } else {
         return false;
      }
   }

   static boolean a(zane var0) throws Exception {
      return var0.a("CONTENTS") == null;
   }

   static boolean b(zane var0) throws Exception {
      return var0.a("\u0001Ole10Native") != null;
   }

   static byte[] a(String var0) {
      return zco.a(var0);
   }

   public static boolean b(String var0) {
      char[] var1 = var0.toCharArray();
      int var2 = 0;

      while(var2 < var1.length) {
         if (var2 == 0) {
            if (Character.isDigit(var1[var2])) {
               return true;
            }

            switch(var1[var2]) {
            case 'C':
            case 'R':
            case 'c':
            case 'r':
               if (var2 + 1 < var1.length && Character.isDigit(var1[var2 + 1])) {
                  return true;
               }
            }
         }

         switch(var1[var2]) {
         case ' ':
         case '!':
         case '#':
         case '$':
         case '%':
         case '&':
         case '\'':
         case '(':
         case ')':
         case '+':
         case ',':
         case '-':
         case '.':
         case '<':
         case '=':
         case '>':
         case '@':
         case '\\':
         case '{':
         case '|':
         case '}':
         case '~':
         case '　':
         case '（':
         case '）':
         case '－':
            return true;
         default:
            ++var2;
         }
      }

      return d(var0);
   }

   public static boolean c(String var0) {
      char[] var1 = var0.toCharArray();
      int var2 = 0;

      while(var2 < var1.length) {
         switch(var1[var2]) {
         case '!':
         case '+':
         case '-':
         case '[':
         case ']':
            return true;
         default:
            ++var2;
         }
      }

      int[] var3 = CellsHelper.a(var1, 0, var1.length - 1, false, 1048575, 16383);
      if (var3 != null && var3[0] != -1) {
         if (var3[0] == -1) {
            return false;
         } else if (var3[1] > 16383) {
            return false;
         } else {
            return true;
         }
      } else {
         return false;
      }
   }

   public static boolean d(String var0) {
      if (var0 != null && !"".equals(var0)) {
         int[] var1 = CellsHelper.a(var0.toCharArray(), 0, var0.length() - 1, false, 1048575, 16383);
         if (var1 == null) {
            return false;
         } else {
            int var2 = var1[0];
            int var3 = var1[1];
            return var2 >= 0 && var2 <= 1048575 && var3 >= 0 && var3 <= 16383;
         }
      } else {
         return false;
      }
   }

   static void a(Style var0, Style var1, StyleFlag var2) {
      if (var2.getAll()) {
         var2 = new StyleFlag();
         var2.setBorders(true);
         var2.setFont(true);
         var2.setCellShading(true);
         var2.setHideFormula(true);
         var2.setHorizontalAlignment(true);
         var2.setIndent(true);
         var2.setLocked(true);
         var2.setNumberFormat(true);
         var2.setRotation(true);
         var2.setShrinkToFit(true);
         var2.setTextDirection(true);
         var2.setVerticalAlignment(true);
         var2.setWrapText(true);
      }

      if (var2.getBorders()) {
         var1.getBorders().a(var0.getBorders());
      } else {
         if (var2.getLeftBorder()) {
            var1.getBorders().getByBorderType(1).setColor(var0.getBorders().getByBorderType(1).getColor());
            var1.getBorders().getByBorderType(1).setLineStyle(var0.getBorders().getByBorderType(1).getLineStyle());
         }

         if (var2.getRightBorder()) {
            var1.getBorders().getByBorderType(2).setColor(var0.getBorders().getByBorderType(2).getColor());
            var1.getBorders().getByBorderType(2).setLineStyle(var0.getBorders().getByBorderType(2).getLineStyle());
         }

         if (var2.getTopBorder()) {
            var1.getBorders().getByBorderType(4).setColor(var0.getBorders().getByBorderType(4).getColor());
            var1.getBorders().getByBorderType(4).setLineStyle(var0.getBorders().getByBorderType(4).getLineStyle());
         }

         if (var2.getBottomBorder()) {
            var1.getBorders().getByBorderType(8).setColor(var0.getBorders().getByBorderType(8).getColor());
            var1.getBorders().getByBorderType(8).setLineStyle(var0.getBorders().getByBorderType(8).getLineStyle());
         }

         if (var2.getDiagonalDownBorder()) {
            var1.getBorders().getByBorderType(16).setColor(var0.getBorders().getByBorderType(16).getColor());
            var1.getBorders().getByBorderType(16).setLineStyle(var0.getBorders().getByBorderType(16).getLineStyle());
         }

         if (var2.getDiagonalUpBorder()) {
            var1.getBorders().getByBorderType(32).setColor(var0.getBorders().getByBorderType(32).getColor());
            var1.getBorders().getByBorderType(32).setLineStyle(var0.getBorders().getByBorderType(32).getLineStyle());
         }
      }

      if (var2.getFont()) {
         var1.getFont().c(var0.getFont());
      } else {
         if (var2.getFontBold()) {
            var1.getFont().setBold(var0.getFont().isBold());
         }

         if (var2.getFontColor()) {
            var1.getFont().setColor(var0.getFont().getColor());
         }

         if (var2.getFontItalic()) {
            var1.getFont().setItalic(var0.getFont().isItalic());
         }

         if (var2.getFontName()) {
            var1.getFont().a(var0.getFont().getName(), var0.getFont().k());
         }

         if (var2.getFontScript()) {
            var1.getFont().a(var0.getFont().f());
         }

         if (var2.getFontSize()) {
            var1.getFont().setSize(var0.getFont().getSize());
         }

         if (var2.getFontStrike()) {
            var1.getFont().setStrikeout(var0.getFont().isStrikeout());
         }

         if (var2.getFontUnderline()) {
            var1.getFont().setUnderline(var0.getFont().getUnderline());
         }
      }

      if (var2.getNumberFormat()) {
         if (var0.getCustom() != null && !"".equals(var0.getCustom())) {
            var1.setCustom(var0.getCustom());
         } else {
            var1.setNumber(var0.getNumber());
         }
      }

      if (var2.getHorizontalAlignment()) {
         var1.setHorizontalAlignment(var0.getHorizontalAlignment());
      }

      if (var2.getVerticalAlignment()) {
         var1.setVerticalAlignment(var0.getVerticalAlignment());
      }

      if (var2.getIndent()) {
         var1.c(var0.getIndentLevel());
      }

      if (var2.getRotation()) {
         var1.setRotationAngle(var0.getRotationAngle());
      }

      if (var2.getWrapText()) {
         var1.setTextWrapped(var0.isTextWrapped());
      }

      if (var2.getShrinkToFit()) {
         var1.setShrinkToFit(var0.getShrinkToFit());
      }

      if (var2.getTextDirection()) {
         var1.setTextDirection(var0.getTextDirection());
      }

      if (var2.getCellShading()) {
         var1.setForegroundColor(var0.getForegroundColor());
         var1.setBackgroundColor(var0.getBackgroundColor());
         var1.setPattern(var0.getPattern());
      }

      if (var2.getLocked()) {
         var1.setLocked(var0.isLocked());
      }

      if (var2.getHideFormula()) {
         var1.setFormulaHidden(var0.isFormulaHidden());
      }

   }

   static void a(Style var0, Font var1, StyleFlag var2) {
      if (!var2.getFont() && !var2.getAll()) {
         if (var2.getFontBold()) {
            var1.setBold(var0.getFont().isBold());
         }

         if (var2.getFontColor()) {
            var1.setColor(var0.getFont().getColor());
         }

         if (var2.getFontItalic()) {
            var1.setItalic(var0.getFont().isItalic());
         }

         if (var2.getFontName()) {
            var1.b(var0.getFont().getName());
         }

         if (var2.getFontScript()) {
            var1.a(var0.getFont().f());
         }

         if (var2.getFontSize()) {
            var1.setSize(var0.getFont().getSize());
         }

         if (var2.getFontStrike()) {
            var1.setStrikeout(var0.getFont().isStrikeout());
         }

         if (var2.getFontUnderline()) {
            var1.setUnderline(var0.getFont().getUnderline());
         }
      } else {
         var1.c(var0.getFont());
      }

   }

   static void a(int var0) {
      if (var0 < 0 || var0 > 1048575) {
         throw new IllegalArgumentException("Invalid row index.");
      }
   }

   static void b(int var0) {
      if (var0 < 0 || var0 > 16383) {
         throw new IllegalArgumentException("Invalid column index.");
      }
   }

   static void a(int var0, int var1) {
      if (var0 >= 0 && var0 <= 1048575) {
         if (var1 < 0 || var1 > 16383) {
            throw new IllegalArgumentException("Invalid column index.");
         }
      } else {
         throw new IllegalArgumentException("Invalid row index.");
      }
   }

   static void a(int var0, int var1, int var2, int var3) {
      if (var0 >= 0 && var0 <= 1048575) {
         if (var1 >= 0 && var1 <= 16383) {
            if (var2 >= 0 && var2 <= 1048575 && var2 >= var0) {
               if (var3 < 0 || var3 > 16383 || var3 < var1) {
                  throw new IllegalArgumentException("Invalid end column index.");
               }
            } else {
               throw new IllegalArgumentException("Invalid end row index.");
            }
         } else {
            throw new IllegalArgumentException("Invalid start column index.");
         }
      } else {
         throw new IllegalArgumentException("Invalid start row index.");
      }
   }

   static void b(int var0, int var1) {
      if (var0 >= 0 && var0 <= 1048575) {
         if (var1 < 0 || var1 > 1048575 || var1 < var0) {
            throw new IllegalArgumentException("Invalid end row index.");
         }
      } else {
         throw new IllegalArgumentException("Invalid start row index.");
      }
   }

   static void c(int var0, int var1) {
      if (var0 >= 0 && var0 <= 16383) {
         if (var1 < 0 || var1 > 16383 || var1 < var0) {
            throw new IllegalArgumentException("Invalid end column index.");
         }
      } else {
         throw new IllegalArgumentException("Invalid start column index.");
      }
   }

   static int e(String var0) {
      return var0 == null ? 0 : (f(var0) ? var0.length() + 1 : var0.length() * 2 + 1);
   }

   static boolean f(String var0) {
      boolean var1 = true;
      if (var0 != null && !"".equals(var0)) {
         var1 = true;
         byte[] var2 = Encoding.getUnicode().a(var0);

         for(int var3 = 0; var3 < var2.length / 2; ++var3) {
            if (var2[2 * var3 + 1] != 0) {
               var1 = false;
               break;
            }
         }
      }

      return var1;
   }

   static String[] g(String var0) {
      String[] var1 = new String[2];
      if (var0.charAt(0) == '=') {
         var0 = var0.substring(1);
      }

      var1[1] = var0;
      com.aspose.cells.b.a.g.a.ze var2 = new com.aspose.cells.b.a.g.a.ze("!");
      com.aspose.cells.b.a.g.a.zc var3 = var2.a(var0);
      if (var3.c()) {
         String var4 = var0.substring(0, 0 + var3.d()).trim();
         if (var4.charAt(0) == '\'' && var4.charAt(var4.length() - 1) == '\'') {
            var4 = var4.substring(1, 1 + (var4.length() - 2));
            if (var4 == null || "".equals(var4)) {
               throw new CellsException(15, "Invalid worksheet name.");
            }
         }

         var1[0] = var4;
         var1[1] = var0.substring(var3.d() + 1).trim();
      }

      return var1;
   }

   static Object a(WorksheetCollection var0, int var1, char[] var2) {
      Object var3 = a(var2);
      if (var3 == null) {
         var3 = var0.getNames().a(new String(var2), var1);
      }

      if (var3 == null) {
         String var4 = new String(var2);

         for(int var5 = 0; var5 < var0.getCount(); ++var5) {
            ListObject var6 = var0.get(var5).getListObjects().a(var4);
            if (var6 != null) {
               CellArea var7 = new CellArea();
               var7.StartRow = var6.getStartRow();
               var7.EndRow = var6.getEndRow();
               var7.StartColumn = var6.getStartColumn();
               var7.EndColumn = var6.getEndColumn();
               return var7;
            }
         }
      }

      return var3;
   }

   static Object a(char[] var0) {
      int var1 = var0.length - 1;
      byte var2 = 0;
      int var3 = -1;

      for(int var4 = var2; var4 <= var1; ++var4) {
         char var5 = var0[var4];
         if (var5 == ':') {
            if (var3 != -1) {
               return null;
            }

            var3 = var4;
         }
      }

      if (var3 != 0 && var3 != var1) {
         int[] var7;
         if (var3 != -1) {
            var7 = a(var0, var2, var3 - 1, 'S');
            if (var7 == null) {
               return null;
            } else {
               int[] var9 = a(var0, var3 + 1, var1, 'E');
               if (var9 == null) {
                  return null;
               } else {
                  CellArea var6 = new CellArea();
                  var6.StartRow = var7[0];
                  var6.StartColumn = var7[1];
                  var6.EndRow = var9[0];
                  var6.EndColumn = var9[1];
                  return var6;
               }
            }
         } else {
            var7 = a(var0, var2, var1, 'N');
            if (var7 == null) {
               return null;
            } else {
               CellArea var8 = new CellArea();
               var8.StartRow = var7[0];
               var8.StartColumn = var7[1];
               var8.EndRow = var7[0];
               var8.EndColumn = var7[1];
               return var8;
            }
         }
      } else {
         return null;
      }
   }

   private static int[] a(char[] var0, int var1, int var2, char var3) {
      int[] var4 = new int[2];
      var4[0] = var4[1] = -1;
      boolean var5 = false;
      boolean var6 = false;

      for(int var7 = var1; var7 <= var2; ++var7) {
         char var8 = Character.toUpperCase(var0[var7]);
         if (var8 != '$' && !Character.isLetterOrDigit(var8)) {
            return null;
         }

         if (var8 == '$') {
            if ((var7 == var2 || !Character.isLetter(var0[var7 + 1])) && (var7 == var2 || !Character.isDigit(var0[var7 + 1]))) {
               return null;
            }
         } else if (Character.isLetter(var8)) {
            if (var5) {
               return null;
            }

            var4[1] = 0;

            for(var5 = true; var7 <= var2 && Character.isLetter(var0[var7]); var4[1] = var4[1] * 26 + var8 - 65 + 1) {
               var8 = Character.toUpperCase(var0[var7++]);
            }

            --var7;
            --var4[1];
            if (var4[1] > 16383) {
               return null;
            }
         } else if (Character.isDigit(var8)) {
            if (var6) {
               return null;
            }

            var4[0] = var8 - 48;
            var6 = true;
            ++var7;

            while(var7 <= var2) {
               var8 = var0[var7];
               if (!Character.isDigit(var8)) {
                  return null;
               }

               var4[0] = var4[0] * 10 + var8 - 48;
               if (var4[0] - 1 > 1048575) {
                  return null;
               }

               ++var7;
            }
         }
      }

      --var4[0];
      if (!var6 && !var5) {
         return null;
      } else if ((!var6 || !var5) && var3 == 'N') {
         return null;
      } else {
         if (var3 == 'S') {
            if (!var6) {
               var4[0] = 0;
            }

            if (!var5) {
               var4[1] = 0;
            }
         } else if (var3 == 'E') {
            if (!var6) {
               var4[0] = 65535;
            }

            if (!var5) {
               var4[1] = 255;
            }
         }

         return var4;
      }
   }

   static String b() {
      return "Aspose.Cells for Java";
   }

   static String a(WorksheetCollection var0) {
      String var1 = "Evaluation Warning";
      int var2 = 0;

      for(int var3 = 0; var3 < var0.getCount(); ++var3) {
         if (com.aspose.cells.b.a.zv.b(var0.get(var3).getName(), var1)) {
            ++var2;
            var1 = "Evaluation Warning (" + com.aspose.cells.b.a.zo.a(var2) + ")";
            var3 = 0;
         }
      }

      return var1;
   }

   static String a(WorksheetCollection var0, String var1) {
      int var2 = 2;
      if (var1.charAt(var1.length() - 1) == ')') {
         int var3 = var1.lastIndexOf(40);
         boolean var4 = false;
         int var5 = 0;
         if (var3 != -1) {
            char[] var6 = var1.toCharArray();
            ++var3;

            while(var3 < var6.length - 1) {
               if (!Character.isDigit(var6[var3])) {
                  var4 = false;
                  break;
               }

               var4 = true;
               var5 = var5 * 10 + (var6[var3] - 48);
               ++var3;
            }
         }

         if (var4) {
            var2 = var5 + 1;
         }
      }

      HashMap var7 = new HashMap(var0.getCount());

      for(int var8 = 0; var8 < var0.getCount(); ++var8) {
         var7.put(var0.get(var8).getName().toUpperCase(), var0.get(var8));
      }

      while(true) {
         String var9 = var1 + " (" + com.aspose.cells.b.a.zo.a(var2) + ")";
         if (var7.get(var9.toUpperCase()) == null) {
            return var9;
         }

         ++var2;
      }
   }

   static Object h(String var0) {
      if (zapb.c(var0)) {
         return com.aspose.cells.b.a.zn.a(var0);
      } else {
         String var1 = null;
         switch(var0.charAt(0)) {
         case '$':
         case '€':
         case '￡':
         case '￥':
            var1 = var0.substring(1);
            break;
         default:
            if (var0.charAt(var0.length() - 1) == 8364) {
               var1 = var0.substring(0, 0 + (var0.length() - 1));
            }
         }

         String var2;
         if (var1 != null) {
            if (zapb.c(var1)) {
               return com.aspose.cells.b.a.zn.a(var1);
            }

            var2 = "^\\d{0,4}[ -/]\\d{1,2}[ -/]\\d{0,4}$|^[a-z]{1,9}\\s\\d{1,2},\\s*\\d{2,4}$";
            if (com.aspose.cells.b.a.g.a.ze.b(var0, var2, 66)) {
               try {
                  return DateTime.a(var0).h();
               } catch (Exception var5) {
                  ;
               }
            }
         } else {
            var2 = "^\\d{0,4}[ -/]\\d{1,2}[ -/]\\d{0,4}$|^[a-z]{1,9}\\s\\d{1,2},\\s*\\d{2,4}$";
            if (com.aspose.cells.b.a.g.a.ze.b(var0, var2, 66)) {
               try {
                  return DateTime.a(var0).h();
               } catch (Exception var4) {
                  ;
               }
            }
         }

         return null;
      }
   }

   static boolean b(WorksheetCollection var0, String var1) {
      var1 = var1.toUpperCase();

      for(int var2 = 0; var2 < var0.getCount(); ++var2) {
         if (com.aspose.cells.b.a.zv.b(var0.get(var2).getName().toUpperCase(), var1)) {
            return true;
         }
      }

      return false;
   }

   static int a(zst var0) {
      switch(null.a[var0.ordinal()]) {
      case 1:
         return 1;
      case 2:
         return 2;
      case 3:
         return 3;
      case 4:
         return 4;
      case 5:
         return 5;
      case 6:
         return 6;
      case 7:
         return 7;
      default:
         return 0;
      }
   }
}
